<template>
  <div style="text-align: center">
    登陆中...
  </div>
</template>

<script>
import {initWebsocket} from "@/api/websocket";

export default {
  name: "OAuth2Login",
  data(){
    return{
      code: ''
    }
  },
  methods:{
    giteeLogin(){
      let code = this.$route.query.code;
      let state = this.$route.query.state;
      if (!code || !state) {
        window.close();
      } else {
        let data = {
          'code': code,
          'state': state
        }
        this.$store.dispatch('goLogin',{data,type:'gitee'}).then( res => {
          window.close();
        })
      }
      this.code = code;
    }
  },
  created() {
    this.giteeLogin()
  }
}
</script>

<style scoped>

</style>
